package cn.itcast.feign.client;

import cn.itcast.hmall.dto.common.PageDTO;
import cn.itcast.hmall.dto.item.SearchItemDTO;
import cn.itcast.hmall.pojo.item.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 商品服务 Feign接口
 *
 * TODO 需要远程调用的方法自己补充哦
 *
 */
@FeignClient("itemservice")
public interface ItemClient {
    @GetMapping("/item/findAll")
    List<Item> searchByPage();
    @PostMapping("/item/list")
    PageDTO<Item> searchByPage(@RequestBody SearchItemDTO dto);
    @GetMapping("/item/{id}")
    Item getById(@PathVariable Long id);
    @PostMapping("/item/{id}")
    Boolean decrease(@PathVariable String id);
    @PutMapping("/item/we")
    void comback(@RequestParam String id,@RequestParam Integer num);
}
